package com.itobase.statusDetect.Controller;

import com.itobase.statusDetect.Model.Teaching;
import com.itobase.statusDetect.Repository.TeachingRepository;
import com.itobase.statusDetect.Service.ClientService;
import com.itobase.statusDetect.Service.TeachingService;
import com.itobase.statusDetect.Util.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author htyu
 * @date 2019/4/24
 */
@RestController
@RequestMapping(value = "client")
public class ClientController {

    @Autowired
    ClientService clientService;

    /**
     * 获取教学班列表
     * @return
     */
    @GetMapping("teachingList")
    public Message getTeaching(@RequestParam(required = false) String keyword){
        return Message.success(clientService.getTeaching(keyword));
    }

    /**
     * 获取教师列表
     * @param keyword
     * @return
     */

    @GetMapping("teacherList")
    public Message getTeacher(@RequestParam(required = false) String keyword) throws Throwable {
        return Message.success(clientService.getTeacherList(keyword));
    }
}
